#include <iostream>
#include <vector>
using namespace std;

void procs(vector<vector<char>>& board,int x,int y)
{
	if(x < 0 || x >= board.size() || y < 0 || y > board[0].size())
	{
		return;
	}
	if(board[x][y] == 'o'){
		board[x][y] = 'r';
		procs(board,x+1,y);
		procs(board,x-1,y);
		procs(board,x,y+1);
		procs(board,x,y-1);
	}
}

void slove(vector<vector<char>>& board)
{
	for(int i=0;i < board[0].size();++i){
		procs(board,0,i);
	}
	for(int i=0;i < board[0].size();++i){
		procs(board,board.size()-1,i);
	}
	for(int i=0;i < board.size();++i){
		procs(board,i,0);
	}
	for(int i=0;i < board.size();++i){
		procs(board,i,board[0].size()-1);
	}

	for(int i=0;i<board.size();++i){
		for(int j=0;j<board[0].size();++j){
			if(board[i][j] == 'r'){
				board[i][j] = 'o';
			}else if(board[i][j] == 'o'){
				board[i][j] = 'x';
			}
		}
	}
}

int main()
{
	vector<vector<char>> a={{'x','x','x','x'},{'x','o','o','x'},{'x','x','o','x'},{'x','o','x','x'}};
	slove(a);
	for(int i=0;i<a.size();++i){
		for(int j=0;j<a[0].size();++j){
			cout<<a[i][j];
		}
		cout<<endl;
	}
}
